<?php
$this->sendDebugMessage("standup model start");
$u = $this->userCenter->userList[$ip];
//玩家离开游戏桌
$rid = $u->roomID;
$tid = $u->tableID;
$sid = $u->seatID;

$u->standUp();
$table=$this->userCenter->roomList[$rid]->tableList[$tid];
$sl=$table->standUp($sid);
$response = new Response();

//如果该玩家是当前桌位的最后一个玩家
if(count($sl)==0)
{
	$this->userCenter->roomList[$rid]->deleteTable($tid);
	$response->event = "SE_DESK_DELETE";
	$response->body = '{"tableID":"'.$tid.'"}';
	$this->broadcastGroup($response,$this->userCenter->roomList[$rid]->getFreeUser(),array($ip));
}else{
	$response->event = "SE_STAND_UP_UPDATE";
	$response->body = '{"seatID":"'.$sid.'","userID":"'.$ip.'","createrID":"'.$table->createrID.'","tableID":"'.$tid.'"}';
	$this->broadcastGroup($response,$this->userCenter->roomList[$rid]->getFreeUser(),array($ip));
	$this->broadcastGroup($response,$this->userCenter->roomList[$rid]->tableList[$tid]->getUserList(),array($ip));
}

$response->event = "SE_STAND_UP";
include('getRoomInfo.php');
$this->sendDebugMessage("standup model end");
